home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / cmds / update.man < prev    next >
Text File  |  1992-12-17  |  8KB  |  180 lines

  1. ' $Header: /sprite/src/cmds/update/RCS/update.man,v 1.9 92/12/17 14:38:20 jhh Exp $ SPRITE (Berkeley)
  2. .so \*(]ltmac.sprite
  3. .HS UPDATE cmds
  4. .BS
  5. .SH NAME
  6. update \- A copy program that recursively updates directory trees
  7. .SH SYNOPSIS
  8. \fBupdate\fR [\fIoptions\fR] \fIsrc1 ... srcN targetDir\fR
  9. .br
  10. \fBupdate\fR [\fIoptions\fR] \fIsrc target\fR
  11. .SH OPTIONS
  12. .IP "\fB\-b \fIdirectory\fR" 15
  13. Before updating a target, save a backup copy of the file in
  14. \fIdirectory\fR.
  15. .IP "\fB\-B \fIdays\fR" 15
  16. Only save the target as a backup copy if no backup exists or if the
  17. target is \fIdays\fR days old.  
  18. .IP "\fB\-f\fR" 15
  19. Force:  always update targets regardless of last-modified times.
  20. .IP "\fB\-g \fIgroup\fR" 15
  21. Change the group of any updated files to \fIgroup\fR.  Targets that aren't
  22. updated do not have their groups changed.
  23. .IP "\fB\-help\fR" 15
  24. Print a summary of the command-line options and exit without updating
  25. any targets.
  26. .IP "\fB\-l\fR" 15
  27. If a source file is a symbolic link then \fBupdate\fR normally creates an
  28. identical symbolic link at the destination.  If the \fB\-l\fR switch
  29. is specified, then \fBupdate\fR copies the file referenced by the source link,
  30. rather than the link itself.
  31. .IP "\fB\-L\fR" 15
  32. Creates symbolic links to non-directory source files, rather than copying them.
  33. Directories
  34. are copied in the normal manner. This flag is useful for creating shadow
  35. trees of source directories. If either the source or the destination 
  36. start with '/' the link will be absolute, otherwise it's relative.
  37. .IP "\fB\-m \fImode\fR" 15
  38. When updating a target, set its protection bits to \fImode\fR.  Targets
  39. that aren't updated do not have their protection changed.  \fIMode\fR
  40. must be specified in octal.
  41. .IP "\fB\-n\fR" 15
  42. Be nice about problems with file types not matching (i.e. don't return
  43. an error).
  44. .IP "\fB\-M\fR" 15
  45. When updating a target, do it by moving the source instead of by
  46. copying.  This may be useful when disk space is tight.
  47. .IP "\fB\-o \fIowner\fR" 15
  48. Perform all updates as user \fIowner\fR, so that newly-created targets
  49. will be owned by \fIowner\fR.  Any targets that are not updated will
  50. not have their \fIowner\fR changed.
  51. .IP "\fB\-O\fR" 15
  52. This option preserves ownership on newly created files.  Only root or
  53. wheel group members can use this option.
  54. .VS
  55. .IP "\fB\-p \fIpruneExpr\fR" 15
  56. Prune subtress whose name matches the given regular expression.
  57. .VE
  58. .IP "\fB\-q\fR" 15
  59. Quiet.  Don't print anything except for error messages.  \fBUpdate\fR normally
  60. prints a message for each file copied.
  61. .IP "\fB\-s\fR" 15
  62. Strip.  Source files are all expected to be executable binaries.  When
  63. copying, strip all of the symbol and relocation information from the
  64. updated target.
  65. .IP "\fB\-t\fR" 15
  66. Instead of setting the last-accessed and last-modified times of each
  67. target to match those of its source, leave them alone, so that they are
  68. set to the current time.
  69. .IP "\fB\-v\fR" 15
  70. Verify.  Don't actually modify any files, but print information about
  71. which files would have been modified.
  72. .BE
  73.  
  74. .SH INTRODUCTION
  75. .PP
  76. The \fBupdate\fR command is used to replace out-of-date copies of files with
  77. more recent versions.  It operates on one or more source files.  For
  78. each source, \fBupdate\fR locates a corresponding target;  if the target
  79. doesn't exist, or if the last-modified
  80. time of the source is later than the last-modified time
  81. of the target, or if the \fB\-f\fR option
  82. is specified, then \fBupdate\fR makes a copy of the source at the target.
  83. The target's last-modified time and permissions will be set identical
  84. to those of the source.
  85. .PP
  86. In the simplest case, two file names are given, both of which are
  87. regular files.  In this case the first file name is the source and
  88. the second is the target.  If the last file name refers to
  89. a directory, then all the other file names (of which there may be
  90. more than one) are sources.
  91. Each source file will be updated to the corresponding file
  92. \fIwithin\fR the target directory.  For example, in the command
  93. .DS
  94. \fBupdate /a/b c d foo\fR
  95. .DE
  96. the target for \fB/a/b\fR will be \fBfoo/b\fR, the target for \fBc\fR
  97. will be \fB/foo/c\fR, and the target for \fBd\fR will be \fBfoo/d\fR.
  98. .PP
  99. If any of the source files is a directory, then its entire subtree will
  100. be updated to the corresponding target, maintaining the subtree
  101. structure of the
  102. source.  In the special case where only two file names are given
  103. and both are directories, then the source is updated \fIto\fR
  104. the target directory rather than \fIwithin\fR it.  Thus, in the command
  105. .DS
  106. \fBupdate a b\fR
  107. .DE
  108. where \fBa\fR and \fBb\fR are both directories and
  109. \fBa\fR contains one subdirectory \fBc\fR which in turn
  110. contains one file \fBd\fR, the target corresponding
  111. to \fBa/c/d\fR will be \fBb/c/d\fR.  \fBUpdate\fR will create the
  112. directory \fBb/c\fR if it doesn't already exist.
  113. .PP
  114. \fBUpdate\fR will also copy symbolic links.  Normally it creates matching
  115. symbolic links at the targets, but it will copy the files pointed to
  116. by the links if the \fB\-l\fR switch is given.
  117. .PP
  118. If the target for a source already exists but has a type different from
  119. the source (e.g. the target is a directory and the source is a regular
  120. file), then \fBupdate\fR will not modify the target.  If the target's last-modified
  121. time is more recent than the source's, then again \fBupdate\fR will not modify
  122. the target.
  123.  
  124. .SH "USER AND GROUP CHANGES"
  125. .PP
  126. There are several restrictions on usage of the \fB\-O\fR, \fB\-o\fR and \fB\-g\fR
  127. switches.
  128. You may specify \fB\-O\fR only if you are root or in the wheel group.
  129. You may specify \fB\-g \fIgroup\fR as long as you are a member
  130. of \fIgroup\fR.
  131. You may specify \fB\-o \fIowner\fR if either
  132. .IP [1]
  133. You are \fIowner\fR (which isn't very interesting).
  134. .IP [2]
  135. \fIOwner\fR is \fBroot\fR, and you are a member of the \fBwheel\fR group.
  136. .IP [3]
  137. There is a group with the same name as \fIowner\fR and you are a member
  138. of that group.
  139.  
  140. .SH "SET-USER_ID"
  141. .PP
  142. If you haven't specified the \fB\-m\fR switch, then \fBupdate\fR attempts
  143. to preserve set-user-id bits.  It also attempts to preserve set-user-id
  144. bits when making backup copies, even if the \fB\-m\fR switch was given.
  145. However, set-user-id bits are not preserved unless the owner of the
  146. target file is the same as the owner of the source file (this condition
  147. is always true if the \fB\-O\fR switch is given).
  148.  
  149. .SH "BACKUP FILES"
  150. .PP
  151. If the \fB\-b\fR switch is specified, then \fBupdate\fR attempts to
  152. ensure that a backup copy of the target is saved, if the target
  153. already exists.  If a backup already exists, then the backup is
  154. overwritten only if the target is relatively old (a parameter that
  155. defaults to files two weeks old and may be overridden by the \fB-B\fR
  156. switch, specifying the requisite age in days).  If the \fB-B\fR switch
  157. specifies an age of 0, then the most 
  158. recent target will always be backed up.  Normally, the default of 14
  159. (two weeks) is used to guarantee that an unstable file does not
  160. overwrite a stable backup.
  161.  
  162. .VS
  163. .SH "PRUNING SUB-TREES"
  164. .PP
  165. The \fB\-p\fR option can be used to prune unwanted sub-trees from the source
  166. files. The argument is a regular expression that is matched against all source
  167. files before updating them.  If the expression matches then the source is
  168. not updated.  The expression is matched against only the tail of the source
  169. path name, so using an expression of "foo/bar" will not do what you think
  170. it will. If the argument contains any magic characters such as "*" then you
  171. better put it inside of quotes otherwise csh will glob it first.  Multiple
  172. \fB\-p\fR options can be specified and will be compared against the source files
  173. one at a time. 
  174. .VE
  175. .SH KEYWORDS
  176. copy, up-to-date
  177.  
  178. .SH "SEE ALSO"
  179. cp, mv, tar
  180.